package net.jkdmanager.common.api.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;

@Entity
public class Application implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6699658264910330094L;
	
	@Id 
	@GeneratedValue
    private Long id;
	
	@Column(name="appEnabled")
	@Basic
	private boolean enabled;
	
	@Basic
	private String agentId;
	
	@OneToOne(fetch=FetchType.EAGER, orphanRemoval=true, cascade=CascadeType.ALL)
	private PluginConfig runner;
	
	@OneToOne(fetch=FetchType.EAGER, orphanRemoval=true, cascade=CascadeType.ALL)
	private PluginConfig director;
	
	@OneToOne(fetch=FetchType.EAGER, orphanRemoval=true, cascade=CascadeType.ALL)
	private PluginConfig distributor;
	
	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getId() {
		return id;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public String getAgentId() {
		return agentId;
	}

	public void setAgentId(String agentId) {
		this.agentId = agentId;
	}

	public PluginConfig getRunner() {
		return runner;
	}

	public void setRunner(PluginConfig runner) {
		this.runner = runner;
	}

	public PluginConfig getDirector() {
		return director;
	}

	public void setDirector(PluginConfig director) {
		this.director = director;
	}

	public PluginConfig getDistributor() {
		return distributor;
	}

	public void setDistributor(PluginConfig distributor) {
		this.distributor = distributor;
	}
	
}
